<template>
  <div>
      <h1>{{msg}}</h1>
      <button v-on:click="show">点我</button>
      <input type="text" name="" id="" v-model="inputmsg">
      <button v-on:click="add">向数组中添加元素</button>
      <ul>
          <li v-for="(item,index) of arr" :key="index">{{item}}</li>
      </ul>
  </div>
</template>
<script>
export default {
  name: 'Von',
  data() {
      return {
          msg: 'v-on绑定事件',
          arr: [1,2,3,4,5,6],
          inputmsg: 1
      }
  },
  methods: {
      show() {
          console.log("show方法被点击");
      },
      add() {
          this.arr.push(this.inputmsg)
      }
  }
}
</script>




